<!--
 * @Author: H.
 * @Date: 2021-08-10 08:38:38
 * @LastEditTime: 2021-11-24 17:11:31
 * @Description: 
-->
<template>
  <h1>Switch 示例</h1>
  <Demo :component="SwitchDemo1" />
  <Demo :component="SwitchDemo2" />
  <h2>Switch Attributes</h2>
  <Table :dataSource="dataSource" :columns="columns" />
</template>

<script lang="ts">
import SwitchDemo1 from './Demo/Switch1.demo.vue'
import SwitchDemo2 from './Demo/Switch2.demo.vue'
import Demo from './Demo/index.vue'
import { ref } from 'vue'
import Table from '../lib/table/Table.vue'

export default {
  setup() {
    const dataSource = [
      {
        id: 1,
        params: 'v-model:value',
        illustrate: '绑定值',
        type: 'boolean',
        optional: '-',
        defaults: '-',
      },
      {
        id: 2,
        params: 'disabled',
        illustrate: '是否禁用',
        type: 'boolean',
        optional: '-',
        defaults: 'false',
      },
    ]
    const columns = [
      { title: '参数', prop: 'params', width: '300' },
      { title: '说明', prop: 'illustrate', width: '300' },
      { title: '类型', prop: 'type', width: '100' },
      { title: '可选值', prop: 'optional', width: '100' },
      { title: '默认值', prop: 'defaults' },
    ]
    return { SwitchDemo1, SwitchDemo2, columns, dataSource }
  },
  components: {
    SwitchDemo1,
    SwitchDemo2,
    Demo,
    Table,
  },
}
</script>
